package com.neo.impatient.C04_MapTuple.C04_04_iterator

object IteratorMap {


  def main(args: Array[String]): Unit = {
    val scores = scala.collection.mutable.Map("aa" -> 4, "bb" -> 6 , "cc" -> 7)
    println(scores)
    println("同时获取kv")
    for((k,v) <- scores)
      println(k + " : " + v)

    println("仅获取k 或者V")
    for( k <- scores.keys)
      println(k)

    for(v <- scores.values)
      println(v)

    println("反转一个Map可以用生成器")

    val sores2 =  for((k,v) <- scores) yield (v,k)
    println(sores2)
  }
}
